﻿using HtmlAgilityPack;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NotaManager
{
    public static class HtmlHelper
    {
        public static HtmlNode ElementWithAttribute(this IEnumerable<HtmlNode> nodes, string attributeName, string attributeValue)
        {
            var temp = nodes.
                FirstOrDefault(node => node.Attributes.Any(attr => attr.Name == attributeName && attr.Value.Contains(attributeValue)));

            return temp;
        }

    }
}
